<script setup>
import {ref} from 'vue'
import {useRouter} from 'vue-router'
const router=useRouter()
import _ from 'lodash'

const list = ref([
  {
    name: 'home',
    meta: {
      icon: 'md-stats',
      title: '首页'
    },
  },
  {
    name: 'test',
    meta: {
      icon: 'md-stats',
      title: 'test'
    },
  }
])

const turnToPage=(item)=> {
  router.push(item.name)
  _.forEach(list.value,(v)=>{
    console.log(v)
  })
}
</script>

<template>
  <div class="header-container">
    <div v-for="item in list" :key="item.name"  @click="turnToPage(item)">
      {{ item.meta.title }}
    </div>
  </div>
</template>

<style>

</style>
